package com.booksystem.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 *   统一响应结果封装类
 * </p>
 * @author 段伟豪
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ApiModel(description = "统一响应结果")
public class RestResult<T> {

    /**
     * 业务返回码
     */
    private String code;

    /**
     * 业务提示信息
     */
    private String msg;

    /**
     * 业务数据
     */
    private T data;

    public RestResult(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
